package tech.yuliu.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tech.yuliu.service.WordService;
import tech.yuliu.utils.ResultJson;

@RestController
@RequestMapping({"/word"})
@Slf4j
public class WordController {

    @Autowired
    WordService wordService;

    @GetMapping("/search/{wordStr}")
    public ResultJson searchWord(@PathVariable String wordStr) {
        log.info(String.format("接受参数: %s", wordStr));
        return wordService.searchWord(wordStr);
    }
}
